/////////////////////////////////////////////////////////
//                                                     //
// Copyright (c) 2016年 上证云平台. All rights reserved. //
//                                                     //
/////////////////////////////////////////////////////////

#import "IPODetailViewController.h"
#if __has_include("MIPODetailView.h")
#import "MIPODetailView.h"

@interface IPODetailViewController ()<MIPODetailViewDelegate>
{
    MIPODetailView *detailView;
}
@end

@implementation IPODetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStyleDone target:self action:@selector(close)];
    detailView = [[MIPODetailView alloc]init];
    detailView.delegate = self;
    [self.view addSubview:detailView];
    [detailView loadDataWithCode:self.code];
}

- (void)viewDidLayoutSubviews
{
    [super viewDidLayoutSubviews];
    detailView.frame = self.view.bounds;
}

- (void)close {
    [self dismissViewControllerAnimated:YES completion:NULL];
}

- (void)IPODetailView:(MIPODetailView *)detailView didSelectStockWithCode:(NSString *)code
{
    
    NSLog(@"Selected Stock: %@", code);
}

@end
#endif